//
//  main.m
//  Class
//
//  Created by mac on 16-4-12.
//  Copyright (c) 2016年 zzn. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Atom.h"
#import "Animal.h"
#import "Person.h"
#import "Mouse.h"

int main(int argc, const char * argv[])
{

    @autoreleasepool {
        
        // insert code here...
        NSLog(@"Hello, World!");
        Atom * atom = [[Atom alloc] init];
        NSLog(@"Atom chemical element name:%@",atom.chemicalElement);
        Animal *ani = [[Animal alloc] init];
        ani.name = @"我是动物类";
        
        Person *p =[[Person alloc] init];
        p.name = @"Lily";
        
        Mouse * mouse =[[Mouse alloc] init];
        mouse.name = @"老鼠";
        
        NSArray * arr = @[p,mouse];
        for (int i=0; i<arr.count; i++) {
            Animal *ani = arr[i];
            [ani eat];
            [ani sleep];
        }
        [p say];
        [mouse makeRole];
     
//        NSArray *arr = @[ani,p,mouse];
//        NSLog(@"names:%@",[arr componentsJoinedByString:@","]);
//        
//        
//        NSString *str = @"a,b,c,d";
//        NSArray *ano = [str componentsSeparatedByString:@","];
//        ano = [ano sortedArrayUsingSelector:@selector(compare:)];
//        for (int i=0;i<ano.count;i++) {
//            NSString *s = ano[i];
//            NSLog(@"%d,%@",i,s);
//        }
//        NSArray *numbers
//        
        
    }
    return 0;
}

